package com.ruoyi.fs.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fs.mapper.FsRepayMapper;
import com.ruoyi.fs.domain.FsRepay;
import com.ruoyi.fs.service.IFsRepayService;

/**
 * 还款明细Service业务层处理
 * 
 * @author hero
 * @date 2024-09-09
 */
@Service
public class FsRepayServiceImpl implements IFsRepayService 
{
    @Autowired
    private FsRepayMapper fsRepayMapper;

    /**
     * 查询还款明细
     * 
     * @param id 还款明细主键
     * @return 还款明细
     */
    @Override
    public FsRepay selectFsRepayById(Long id)
    {
        return fsRepayMapper.selectFsRepayById(id);
    }

    /**
     * 查询还款明细列表
     * 
     * @param fsRepay 还款明细
     * @return 还款明细
     */
    @Override
    public List<FsRepay> selectFsRepayList(FsRepay fsRepay)
    {
        return fsRepayMapper.selectFsRepayList(fsRepay);
    }

    /**
     * 新增还款明细
     * 
     * @param fsRepay 还款明细
     * @return 结果
     */
    @Override
    public int insertFsRepay(FsRepay fsRepay)
    {
        fsRepay.setCreateTime(DateUtils.getNowDate());
        return fsRepayMapper.insertFsRepay(fsRepay);
    }

    /**
     * 修改还款明细
     * 
     * @param fsRepay 还款明细
     * @return 结果
     */
    @Override
    public int updateFsRepay(FsRepay fsRepay)
    {
        fsRepay.setUpdateTime(DateUtils.getNowDate());
        return fsRepayMapper.updateFsRepay(fsRepay);
    }

    /**
     * 批量删除还款明细
     * 
     * @param ids 需要删除的还款明细主键
     * @return 结果
     */
    @Override
    public int deleteFsRepayByIds(Long[] ids)
    {
        return fsRepayMapper.deleteFsRepayByIds(ids);
    }
    /**
     * 获取账单id列表
     *
     * @param ids 还款明细主键集合
     * @return 结果
     */
    @Override
    public List<Long> getBillIdsByIds(Long[] ids){
        return fsRepayMapper.getBillIdsByIds(ids);
    }


    /**
     * 删除还款明细信息
     * 
     * @param id 还款明细主键
     * @return 结果
     */
    @Override
    public int deleteFsRepayById(Long id)
    {
        return fsRepayMapper.deleteFsRepayById(id);
    }
}
